home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_getwheel.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  173 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_getwheel.cog
  4. #    
  5. # grab wheel from the broken minecar in the pit
  6. #
  7. # [RKD]
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13. message        activated
  14.  
  15. # actors
  16. thing    player        nolink    local
  17. thing    indyactor    nolink
  18. thing    indyactor2    nolink
  19.  
  20. # world things
  21. thing    wheel
  22. thing    minecar
  23.  
  24. # camera things
  25. thing    wheelcam    nolink
  26. thing    hintcam        nolink
  27.  
  28. # voicelines
  29. sound    glorydays=pr14j01.wav    local
  30. sound    salvage=pr14j02.wav        local
  31. sound    rollagain=pr14j03.wav    local
  32.  
  33. # sounds
  34. sound    takeoff=sea_launch_wheel_attach.wav    local
  35.  
  36. # subroutines
  37. flex    startscene=0.0    local
  38. flex    endscene=0.0    local
  39. flex    fixcams=0.0        local
  40. flex    changecam=0.0    local
  41. end
  42.  
  43. code
  44. activated:
  45. # ---> Wheel, MineCar    
  46.     if (GetThingFlags(wheel) & 0x10) return;
  47.  
  48.     player = GetLocalPlayerThing();
  49.     
  50.     # if wheel is activated, grab it
  51.     if (GetSenderRef() == wheel)
  52.     {
  53.         # prepare player
  54.         if (MakeMeStop() == -1) return;
  55.         DeselectWeaponWait(player);
  56.         
  57.         call fixcams;
  58.         call startscene;
  59.         call changecam;
  60.         
  61.         PlayVoice(indyactor, rollagain, 1, 0);
  62.         AISetLookThing(indyactor, wheel);
  63.         sleep(.5);
  64.         PlayMode(indyactor, 60, 0);
  65.         sleep(.5);
  66.         PlaySoundThing(takeoff, wheel, 1, -1, -1, 0);
  67.         SetThingFlags(wheel, 0x10);
  68.  
  69.         # add wheel to inventory
  70.         SetInvAvailable(player, 64, 1);
  71.         ChangeInv(player, 64, 1.0);
  72.         JonesInvItemChanged(64);
  73.         
  74.         Sleep(1.5);
  75.         
  76.         call endscene;
  77.     }
  78.  
  79.     # if minecar is activated, indy talks
  80.     if (GetSenderRef() == minecar)
  81.     {
  82.         # prepare player
  83.         if (MakeMeStop() == -1) return;
  84.         DeselectWeaponWait(player);
  85.         
  86.         StartCutscene(1);
  87.     
  88.         # switcheroo to floating actor
  89.         TeleportThing(indyactor2, player);
  90.         CopyPlayerHolsters(player, indyactor2);
  91.         ClearThingFlags(indyactor2, 0x80000);
  92.         SetActorFlags(player, 0x200000);
  93.         SetThingFlags(player, 0x80000);
  94.     
  95.         # bring camera round
  96.         SetExtCamOffset('0.15 -.1 0.09');
  97.         
  98.         # start the action
  99.         SetThingMaxRotVel(indyactor2, 175);
  100.         SetThingMaxHeadVel(indyactor2, 175);
  101.         AISetLookThing(indyactor2, minecar);
  102.         AIWaitForStop(indyactor2);
  103.         
  104.         Sleep(1.0);
  105.         
  106.         # Professor Jones sez...
  107.         PlayVoice(indyactor, glorydays, 1, 1);
  108.         PlayVoice(indyactor, salvage, 1, 1);
  109.         
  110.         Sleep(0.75);
  111.         
  112.         # back to reality
  113.         TeleportThing(player, indyactor2);
  114.         SetThingFlags(indyactor2, 0x80000);
  115.         ClearThingFlags(player, 0x80000);
  116.         ClearActorFlags(player, 0x200000);
  117.         RestoreExtCam();
  118.         EndCutscene();
  119.     }
  120.  
  121.     return;
  122.     
  123. changecam:
  124.     # change to wheelcam
  125.     SetCameraFocus(2, wheelcam);
  126.     SetCameraSecondaryFocus(2, wheel);
  127.     SetCurrentCamera(2);
  128.     ResetCameraFOV(0, 0);
  129.     return;
  130.  
  131. startscene:
  132.     call fixcams;
  133.  
  134.     StartCutscene(0);
  135.     CopyOrientAndPos(indyactor, player);
  136.     CopyPlayerHolsters(player, indyactor);
  137.     ClearThingFlags(indyactor, 0x80000);
  138.     SetActorFlags(player, 0x200000);
  139.     SetThingFlags(player, 0x80000);
  140.         
  141.     return;
  142.             
  143. endscene:
  144.     call fixcams;
  145.  
  146.     CopyOrientAndPos(indyactor, player);
  147.     SetThingFlags(indyactor, 0x80000);
  148.     ClearThingFlags(player, 0x80000);
  149.     ClearActorFlags(player, 0x200000);
  150.     SetCurrentCamera(1);
  151.     EndCutscene();
  152.  
  153.     # clean up a bit
  154.     DestroyThing(indyactor);
  155.     DestroyThing(indyactor2);
  156.     DestroyThing(wheelcam);
  157.     DestroyThing(hintcam);
  158.  
  159.     return;
  160.  
  161. fixcams:
  162.     # reset camera settings
  163.     ResetCameraFOV(0, 0);
  164.     SetCameraPosInterp(2, 0);
  165.     SetCameraLookInterp(2, 0);
  166.     SetCameraPosInterp(1, 0);
  167.     SetCameraLookInterp(1, 0);
  168.     RestoreExtCam();
  169.     return;
  170.     
  171. end
  172.  
  173.